package com.lyun.common;

import com.lyun.pojo.User;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 获取标签
 * @author 卓思华
 * @version 1.0
 * @date 2022/6/7 9:10
 */
@Component
public class GetTags {
    private final Map<String,String> someTags = new HashMap<String, String>(){
        {
            put("woman","女性");
            put("man", "男性");
            put("0", "单身");
            put("1", "已婚");
        }
    };

    public List<String> getTags(User user) {
        List<String> tags = new ArrayList<>();
        tags.add(someTags.get(user.getGender()));
        tags.add(someTags.get(user.getMarriage().toString()));
        return tags;
    }
}